import request from '@/utils/request'

export default {
    // 1、讲师列表（条件查询分页）,
    // 参数current：当前页   limit：每页记录的数    reacherQuery：条件对象
    getTeacherListPage(current,limit,teacherQuery) {
        return request({
            // url:'/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',

            // teacherQuery条件对象，后端使用RequestBody 获取数据
            // data表示把对象转换成json进行传递到接口里面
            data: teacherQuery
        })
    },
    deleteTeacherId(id){        //删除讲师
        return request({
            url:`/eduservice/teacher/${id}`,
            method: 'delete'
        })
    },
    addTeacher(teacher){        //添加讲师
        return request({
            url:`/eduservice/teacher/addTeacher`,
            method:'post',
            data: teacher
        })
    },
    getTeacherInfo(id){     //根据id 进行查询讲师
        return request({
            url:  `/eduservice/teacher/getTeacher/${id}`,
            method: 'get'
            // data: teacher
        })
    },
    updateTeacherInfo(teacher){     //修改讲师信息
        return request({
            url:  `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data: teacher
        })
    }
}
